package dao;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

import model.AgenceCTM;

@Stateless
public class AgenceCTMDaoImpl implements IAgenceCTMDao {

	@PersistenceContext(unitName = "putravel")
	EntityManager em;

	@Override
	public AgenceCTM findAgence(String idagence) {
		Query req = em
				.createQuery("select a from  AgenceCTM a where a.idagence=:id");
		req.setParameter("id", idagence);
		return (AgenceCTM) req.getSingleResult();
	}

}
